@model IEnumerable<ShivamEMR.Model.Domain.CRMDomain.Assignment>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table cellspacing="10">
    <tr>
        <th></th>
        <th>
            DateAndTime
        </th>
        <th>
            Occasion
        </th>
      @*  <th>
            Notes
        </th>*@
        <th>
            Employee
        </th>
        <th>
            Person
        </th>
        <th>
            Venue
        </th>
        <th>
            Group
        </th>
        <th>
            Status
        </th>
      @*  <th>
            Admission
        </th>*@
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
        <td>
			@String.Format("{0:g}", item.DateAndTime)
        </td>
        <td>
			@item.Occasion
        </td>
      @*  <td>
			@item.Notes
        </td>*@
        <td>
			@(item.Employee == null ? "None" : item.Employee.FullName)
        </td>
        <td>
			@(item.Person == null ? "None" : item.Person.FullName)
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Venue.Title).ToString()
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Group.Group).ToString()
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Status.Status).ToString()
        </td>
      @*  <td>
			@Html.DisplayTextFor(_ => item.Admission).ToString()
        </td>*@
    </tr>
}

</table>


